//
//  DetailTableViewHeader.m
//  练习06
//
//  Created by hcios on 2017/7/7.
//  Copyright © 2017年 hcios. All rights reserved.
//

#import "MoveHeaderView.h"
#import "UIImageView+WebCache.h"

#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
#define FONT_NAME_LTH                   @"FZLanTingHeiS-R-GB"

@implementation MoveHeaderView


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupSubViews];
    }
    return self;
}


-(void)setupSubViews{
    
    //_headImageView
    _headImageView = [[UIImageView alloc] initWithFrame:self.bounds];
    [self addSubview:_headImageView];
    
    
    //_header_nameLab
    _header_nameLab = [[UILabel alloc] initWithFrame:CGRectMake(0, self.frame.size.height / 2, self.frame.size.width, 30)];
    [_header_nameLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:25]];
    [_header_nameLab setTextColor:[UIColor whiteColor]];
    _header_nameLab.textAlignment = NSTextAlignmentCenter;
    _header_nameLab.shadowColor = [UIColor grayColor];
    _header_nameLab.shadowOffset = CGSizeMake(1, 1);
    [_headImageView addSubview:_header_nameLab];
    
    
    //_header_line1
    _header_line1 = [[UIImageView alloc] initWithFrame:CGRectMake(50, CGRectGetMaxY(_header_nameLab.frame) + 5, (SCREEN_WIDTH - 125) / 2, 2)];
    _header_line1.backgroundColor = [UIColor whiteColor];
    [_headImageView addSubview:_header_line1];
    
    
    //_circle
    _circle = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_header_line1.frame) + 10, CGRectGetMaxY(_header_nameLab.frame) + 4, 5, 5)];
    _circle.backgroundColor = [UIColor whiteColor];
    _circle.layer.cornerRadius = 2.5;
    _circle.layer.masksToBounds = YES;
    [_headImageView addSubview:_circle];
    
    
    //_header_line2
    _header_line2 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_circle.frame) + 10, CGRectGetMaxY(_header_nameLab.frame) + 5, (SCREEN_WIDTH - 125) / 2, 2)];
    _header_line2.backgroundColor = [UIColor whiteColor];
    [_headImageView addSubview:_header_line2];
    
    
    //_header_titleLab
    _header_titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_header_line1.frame) + 5, self.frame.size.width, 20)];
    [_header_titleLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:15]];
    [_header_titleLab setTextColor:[UIColor whiteColor]];
    _header_titleLab.textAlignment = NSTextAlignmentCenter;
    _header_titleLab.shadowColor = [UIColor grayColor];
    _header_titleLab.shadowOffset = CGSizeMake(1, 1);
    [_headImageView addSubview:_header_titleLab];
    
}

@end
